package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AgentFallBack;
import cn.cs.fallback.AgentInvoiceFallBack;
import cn.cs.pojo.Agent;
import cn.cs.pojo.AgentInvoice;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = AgentInvoiceFallBack.class)
public interface AgentInvoiceClient {

    @RequestMapping(value = "/getAgentInvoiceById", method = RequestMethod.POST)
    public AgentInvoice getAgentInvoiceById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getAgentInvoiceByOrderNum", method = RequestMethod.POST)
    public AgentInvoice getAgentInvoiceByOrderNum(@RequestParam("orderNum") String orderNum) throws Exception;

    @RequestMapping(value = "/getAgentInvoiceListByMap", method = RequestMethod.POST)
    public List<AgentInvoice> getAgentInvoiceListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getAgentInvoiceCountByMap", method = RequestMethod.POST)
    public Integer getAgentInvoiceCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/insertAgentInvoice", method = RequestMethod.POST)
    public Integer insertAgentInvoice(@RequestBody AgentInvoice agentInvoice) throws Exception;

    @RequestMapping(value = "/updateAgentInvoice", method = RequestMethod.POST)
    public Integer updateAgentInvoice(@RequestBody AgentInvoice agentInvoice) throws Exception;

    @RequestMapping(value = "/deleteAgentInvoiceById", method = RequestMethod.POST)
    public Integer deleteAgentInvoiceById(@RequestParam("id") String id) throws Exception;
}

